package com.ruoyi.system.service.impl;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ProjectIssueMapper;
import com.ruoyi.system.domain.ProjectIssue;
import com.ruoyi.system.service.IProjectIssueService;

/**
 * 项目问题Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-07
 */
@Service
public class ProjectIssueServiceImpl implements IProjectIssueService 
{
    @Autowired
    private ProjectIssueMapper projectIssueMapper;

    //查询项目详情列表
    @Override
    public List<ProjectIssue> selectProjectIssueList(Long proId)
    {
        return projectIssueMapper.selectProjectIssueList(proId);
    }

    //新增项目详情列表
    @Override
    public int insertProjectIssue(ProjectIssue projectIssue)
    {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        Date date = new Date();
        Date createTime=null;
        try {
            createTime=df.parse(df.format(date));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        projectIssue.setIssCreateTime(createTime);
        return projectIssueMapper.insertProjectIssue(projectIssue);
    }

    @Override
    public int upProjectIssueByIds(Long[] issIds, String issState) {
        return projectIssueMapper.upProjectIssueByIds(issIds,issState);
    }

    //修改项目问题
    @Override
    public int updateProjectIssue(ProjectIssue projectIssue)
    {
        return projectIssueMapper.updateProjectIssue(projectIssue);
    }

   //删除项目问题
    @Override
    public int deleteProjectIssueById(Long issId)
    {
        return projectIssueMapper.deleteProjectIssueById(issId);
    }
}
